package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_order")
public class OrderBean {
    @TableId(value = "pk_orderId", type = IdType.AUTO)
    private Integer id;
    @TableField("o_name")
    private String name;
    @TableField("o_address")
    private String address;
    @TableField("o_phone")
    private String phone;
    @TableField("o_oderDate")
    private LocalDate oderDate=LocalDate.now();
    @TableField("o_total")
    private Integer total;
    @TableField("o_status")
    private String status;
    @TableField(exist = false)
    private List<DetailsBean> details;
    @TableField("fk_userId")
    private Integer userId;

    public OrderBean(String name, String address, String phone, LocalDate oderDate, Integer total, String status, List<DetailsBean> details, Integer userId) {
        this.name = name;
        this.address = address;
        this.phone = phone;
        this.oderDate = oderDate;
        this.total = total;
        this.status = status;
        this.details = details;
        this.userId = userId;
    }

    public OrderBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getOderDate() {
        return oderDate;
    }

    public void setOderDate(LocalDate oderDate) {
        this.oderDate = oderDate;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<DetailsBean> getDetails() {
        return details;
    }

    public void setDetails(List<DetailsBean> details) {
        this.details = details;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "OrderBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", oderDate=" + oderDate +
                ", total=" + total +
                ", status='" + status + '\'' +
                ", details=" + details +
                ", userId=" + userId +
                '}';
    }
}
